﻿        var fullObj=null;
        var fullParentObj = null;
        var NeedRefreshPage = null;
        var _employeeTitle = "";
        function fullScreen(obj) {
            fullObj = obj;
            fullParentObj = $($($(obj)[0].parentElement)[0]);
            $(obj).appendTo($("#full"));
            $("#full").css({ "position": "absolute", "z-index": "100", "text-align": "center", "top": "0px", "left": "0px", "right": "0px", "bottom": "0px", "background": "red", "display": "" });
            /*高为屏幕的高*/
            $("#full").css({
                height: function () {
                    return $(document).height();
                },
                width: "100%"
            });
        }
        function unfullScreen() {
            //alert(fullParentObj[0].id);
            $(fullObj).appendTo(fullParentObj);
            fullParentObj = null;
            $("#full").css({ "display": "none" });
        }

        function unContextMenu(obj) {
            $(obj).bind("contextmenu", false);
        }

        function getCurrentTab() {
            var title = $($("#tabs .tabs-selected")[0]).text();
            return $('#tabs').tabs('getTab', title);
        }

        function _fullScreen() {

            $("#full").css({ "position": "absolute", "z-index": "9999", "text-align": "center", "top": "0px", "left": "0px", "right": "0px", "bottom": "0px", "background": "#eee", "display": "" });
            /*高为屏幕的高*/
            $("#full").css({
                height: function () {
                    return $(document).height();
                },
                width: "100%",
                display:""
            });
            //alert($(document).height());
        }

        function _unfullScreen() {
            $("#full").css({ "display": "none" });
        }
    /*-------------------------------------
    *
    *
    *
    *
    *--------------------------------------*/
    var defaultChannel = null;
    
    function Connect()
    {
        if(defaultChannel == null)
        {
            defaultChannel = new AspNetComet("/DefaultChannel.ashx", _UserID, "defaultChannel");
            defaultChannel.addTimeoutHandler(TimeoutHandler);
            defaultChannel.addFailureHandler(FailureHandler);
            defaultChannel.addSuccessHandler(SuccessHandler);
            defaultChannel.subscribe();
        }
    }
    
    //
    function SuccessHandler(privateToken, alias, message) {
        showMessage('即时消息', message.c.m, 10000);
        //alert(message.c.f);
        //alert(message.c.m);
        //document.getElementById("messages").innerHTML += message.c.f + ": " + message.c.m + "<br/>";
    }
    
    function FailureHandler(privateToken, alias, error)
    {
        //document.getElementById("messages").innerHTML += "error" + error + "<br/>";
        alert(error);
    }
    
    function TimeoutHandler(privateToken, alias)
    {
        //alert("timeout");
        //document.getElementById("messages").innerHTML += "timeout<br/>";
    }    
    